const path = require('path')
const resolve = dir => {
  return path.join(__dirname, '../', dir)
}

const aliasConfig = {
  '@': 'src',
  _config: 'config'
}

exports.vueAlias = (alias) => {
  Object.keys(aliasConfig).forEach(key => {
    alias.set(key, resolve(aliasConfig[key]))
  })
}
const getWebpackAlias = () => {
  const result = {}
  Object.keys(aliasConfig).forEach(key => {
    result[key] = resolve(aliasConfig[key])
  })
  return result
}
exports.webpackAlias = getWebpackAlias()
